#!/bin/bash
. ./var
. ./New_CentOS
. ./NewVitrulHost
. ./ChangeHostame
. ./ChangeIpAddress
. ./Install_vmware_tools
Initialization(){
    OPTION=$(whiptail --title "运维一键初始化-初始化菜单" --menu "请选择想要初始化的选项，上下键进行选择，回车即运行，左右键可选择<Cancel>返回上层！" 25 80 10 \
    "1" "克隆的虚拟机初始化-谨慎使用，该脚本中会触发重启服务器操作" \
    "2" "Initialize a new CentOS Server" \
    "3" "暂时未定义" \
    "4" "Install_vmware_tools" \
    "5" "Change Ip Address" \
    "6" "Change Hostname - 有缺陷，不能取消更改"  \
    "7" "Add_Users--(新建用户的初始密码为666666，根据需求进行更改)" 3>&1 1>&2 2>&3 )

    case $OPTION in
    1)
        B && sleep 3 && newvitrulhost
       # A && sleep 3 && Initialize_a_new_CentOS_Server  && newvitrulhost
        ;;
    2)
        B && sleep 3 && Initialize_a_new_CentOS_Server
        ;;
    3)
        B && sleep 3
        ;;
    4)
        B && sleep 3 && Install_vmware_tools
        ;;
    5)
        B && changeipaddress
        ;;
    6)
        B && changehostname
        ;;
    7)
        B && Add_Users
        ;;
    *) 
        Entry_Menu_Bar
        #rm -rf $dir && Entry_Menu_Bar
        ;;
    esac
}
